//返回顶部
var kk1 = document.querySelector("#kk1");

var ee1 = document.querySelector("#ee1");


//滚动事件，没触发一次，这个事件就执行一次。
window.onscroll = function(){

    //判断他离顶部的距离
    if (document.documentElement.scrollTop > 300 || document.body.scrollTop > 300){
        kk1.style.display = "block";
    }
    else {
        kk1.style.display = "none";
    }



    if (document.documentElement.scrollTop > 225 || document.body.scrollTop > 225){
        ee1.style.position = "fixed";
        ee1.style.top = "0";
    }else {
        ee1.style.position = "relative";
    }
};

kk1.addEventListener('click',function(){
    //距离顶部的距离为x为0，y为0.
    //window.scrollTo(0,0);


    window.scrollTo({
        top: 0 ,
        behavior: 'smooth'
    })

});


//情侣腕表
new Vue({
    el:"#ui2",
    data:{an4:""},
    mounted(){
        axios
            .get('json/json.json')
            .then(response => this.an4 = response.data.pp2)
            .catch(function(error){
                console.log(error);
            })
    }


});


new Vue({
    el:"#wn2",
    data:{an1:""},
    mounted(){
        axios
            .get('json/json.json')
            .then(response => this.an1 = response.data.ul)
            .catch(function(error){
                console.log(error);
            })
    }


});